<template>
  <div class="b-cate-table">
    <el-table :data="tableData" style="width: 100%" :border="true">
      <el-table-column
        align="center"
        type="selection"
        width="50"
      ></el-table-column>
      <el-table-column
        align="center"
        prop="title"
        label="分类名称"
        width="520"
      ></el-table-column>
      <el-table-column
        align="center"
        prop="sort"
        label="排序"
        width="160"
      ></el-table-column>
      <el-table-column
        align="center"
        prop="createTime"
        label="创建时间"
      ></el-table-column>
      <el-table-column
        align="center"
        prop="updateTime"
        label="更新时间"
      ></el-table-column>
      <el-table-column align="center" label="管理" width="260">
        <template slot-scope="scope">
          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)"
            >编辑</el-button
          >
          <el-button
            size="mini"
            type="danger"
            @click="handleDelete(scope.$index, scope.row)"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <div class="b-pagination">
      <el-pagination
        @current-change="jumpPage()"
        :current-page.sync="pagination.curr"
        :page-size="pagination.size"
        layout="total, prev, pager, next"
        :total="pagination.total"
        :hide-on-single-page="true"
      >
      </el-pagination>
    </div>
  </div>
</template>
<script>
export default {
  name: "BCateTable",
  data() {
    return {
      tableData: [
        {
          id: 1,
          cateId: 1,
          tagEffect: "dark",
          tagType: "success",
          cate: "技术文章",
          title: "新建Laravel项目步骤",
          sort: "1",
          hits: "16",
          collect: "6",
          like: "8",
          replies: "2",
          isIndex: false,
          isShow: true,
          isHot: false,
          isTop: false,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        },
        {
          id: 2,
          cateId: 1,
          tagEffect: "dark",
          tagType: "success",
          cate: "技术文章",
          title: "Laravel 创建项目时遇到的问题集合和解决方案",
          sort: "2",
          hits: "32",
          collect: "0",
          like: "18",
          replies: "0",
          isIndex: false,
          isShow: true,
          isHot: true,
          isTop: true,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        },
        {
          id: 3,
          cateId: 2,
          tagEffect: "dark",
          tagType: "success",
          cate: "技术文章",
          title: "Laravel 创建项目时遇到的问题集合和解决方案",
          sort: "2",
          hits: "32",
          collect: "0",
          like: "18",
          replies: "0",
          isIndex: false,
          isShow: true,
          isHot: true,
          isTop: true,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        },
        {
          id: 4,
          cateId: 5,
          tagEffect: "plain",
          tagType: "danger",
          cate: "生活随笔",
          title: "Laravel 创建项目时遇到的问题集合和解决方案",
          sort: "2",
          hits: "32",
          collect: "0",
          like: "18",
          replies: "0",
          isIndex: false,
          isShow: true,
          isHot: true,
          isTop: true,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        },
        {
          id: 5,
          cateId: 2,
          tagEffect: "dark",
          tagType: "success",
          cate: "技术文章",
          title: "Laravel 创建项目时遇到的问题集合和解决方案",
          sort: "2",
          hits: "32",
          collect: "0",
          like: "18",
          replies: "0",
          isIndex: false,
          isShow: true,
          isHot: true,
          isTop: true,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        },
        {
          id: 6,
          cateId: 8,
          tagEffect: "plain",
          tagType: "warning",
          cate: "生活随笔",
          title: "Laravel 创建项目时遇到的问题集合和解决方案",
          sort: "2",
          hits: "32",
          collect: "0",
          like: "18",
          replies: "0",
          isIndex: false,
          isShow: true,
          isHot: true,
          isTop: true,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        },
        {
          id: 7,
          cateId: 9,
          tagEffect: "light",
          tagType: "",
          cate: "团队管理",
          title: "Laravel 创建项目时遇到的问题集合和解决方案",
          sort: "2",
          hits: "32",
          collect: "0",
          like: "18",
          replies: "0",
          isIndex: false,
          isShow: true,
          isHot: true,
          isTop: true,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        },
        {
          id: 8,
          cateId: 1,
          tagEffect: "dark",
          tagType: "success",
          cate: "技术文章",
          title: "Laravel 创建项目时遇到的问题集合和解决方案",
          sort: "2",
          hits: "32",
          collect: "0",
          like: "18",
          replies: "0",
          isIndex: false,
          isShow: true,
          isHot: true,
          isTop: true,
          isElite: false,
          isOriginal: true,
          createTime: "2021-3-4 11:49:29",
          updateTime: "2021-3-4 11:49:38"
        }
      ],
      pagination: { curr: 1, size: 10, total: 1000 }
    };
  },
  methods: {}
};
</script>
<style lang="scss">
.b-cate-table {
  margin-top: 30px;
  .b-pagination {
    margin-top: 20px;
  }
  .has-gutter > tr > th {
    border-top: 1px solid #ababab;
    border-bottom: 1px solid #ababab;
    border-right: 1px solid #dfdfdf;
    background: #ececec;
    color: #333;
  }
  .el-checkbox__inner {
    z-index: 0;
  }
  .el-table--border::after,
  .el-table--group::after,
  .el-table::before {
    background: unset;
  }
}
</style>
